const Contoller = require("egg").Controller;

class StudentController extends Contoller {
    async create() {
        let res = await this.app.model.Student.bulkCreate([{
            username: '张3',
            password: '123456',
            sex: '男'
        }, {
            username: '张1',
            password: '12',
            sex: '男'
        }, {
            username: '张2',
            password: '777',
            sex: '男'
        }]);
        // 成功
        this.ctx.body = res;



    }

    async index() {
        let studentList = await this.app.model.Student.findAll();
        this.ctx.body = studentList;
    }

    async update() {

    }

    async destroy() {

    }
}

module.exports = StudentController;